<?php if (!defined('THINK_PATH')) exit(); /*a:3:{s:70:"D:\Apache24\htdocs\chenxiangyu/application/ebcms\view\index\index.html";i:1488453607;s:72:"D:\Apache24\htdocs\chenxiangyu/application/ebcms\view\common\header.html";i:1488098063;s:72:"D:\Apache24\htdocs\chenxiangyu/application/ebcms\view\common\footer.html";i:1482201112;}*/ ?>
<?php 
                $menu = \ebcms\Tree::tree(my_menu());
                unset($menu['0']['rows']['3']);
                unset($menu['1']['rows']['0']);
                unset($menu['2']['rows']['1']);
                unset($menu['2']['rows']['2']);
                unset($menu['3']);
                //var_dump($menu);die;

             ?>

<!DOCTYPE html>
<html lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
    <title>后台管理系统</title>
    <script type="text/javascript" src="__ROOT__/system/js/jquery.min.js"></script>
    <!-- Bootstrap -->
    <link href="__ROOT__/third/bootstrap/css/bootstrap.min.css" rel="stylesheet">
    <!-- HTML5 Shim and Respond.js IE8 flowers of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]]
    <script src="http://static.ebcms.com/html5shiv/3.7.2/html5shiv.min.js"></script>
    <script src="http://static.ebcms.com/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
    <script src="__ROOT__/third/bootstrap/js/bootstrap.min.js"></script>
    <!-- artDialog -->
    <script type="text/javascript" src="__ROOT__/third/artDialog/jquery.artDialog.js"></script>
    <link rel="stylesheet" type="text/css" href="__ROOT__/third/artDialog/skins/default.css">
    <script type="text/javascript" src="__ROOT__/third/artDialog/artDialog.ext.js"></script>
    <!-- 引入后台样式表 -->
    <link rel="stylesheet" type="text/css" href="__ROOT__/system/css/admin.css">
    <script type="text/javascript" src="__ROOT__/system/js/admin.js"></script>
    <script>
        $(function() {

            // 动作绑定
            $('.ebcms-do').bind('click', function(event) {
                var $this  = $(this);
                if ($this.attr('confirm')) {
                    EBCMS.MSG.confirm($this.attr('confirm'),function(){
                        EBCMS.CORE.do({
                            method:$this.attr('method'),
                            url:$this.attr('url'),
                            data:$this.data()
                        });
                    });
                }else{
                    EBCMS.CORE.do({
                        method:$this.attr('method'),
                        url:$this.attr('url'),
                        data:$this.data()
                    });
                }
            });
            $('.ebcms-go').bind('click', function(event) {
                var $this  = $(this);
                if ($this.attr('confirm')) {
                    EBCMS.MSG.confirm($this.attr('confirm'),function(){
                        location.href=$this.attr('url');
                    });
                }else{
                    location.href=$this.attr('url');
                }
            });
            $('.ebcms-change').each(function(index, el) {
                $(this).data('value',$(this).val());
            });
            $('.ebcms-refresh').bind('click', function(event) {
                location = location;
                return false;
            });
            $('.ebcms-overflow').each(function(index, el) {
                $(this).width($(this).parent().width()-10);
            });
            $('.ebcms-overflow').bind('dblclick', function(event) {
                if ($(this).width() < 200) {
                    var maxwidth = $(window).width()/2;
                    art.dialog({
                        id:'tips',
                        title:'信息预览',
                        lock: false,
                        fixed: false,
                        drag: true,
                    }).content('<div style="max-width:'+maxwidth+'px;">'+$(this).html()+'</div>').show();
                }else{
                    if ($(this).css('overflow') == 'auto') {
                        $(this).css({
                            'overflow': 'hidden',
                            'white-space': 'nowrap'
                        });
                    }else{
                        $(this).css({
                            'overflow': 'auto',
                            'white-space': 'normal'
                        });
                    }
                }
            });
            $('.ebcms-change').change(function() {
                var $this  = $(this);
                if ($this.attr('confirm')) {
                    EBCMS.MSG.confirm($this.attr('confirm'),function(){
                        $this.data('value', $this.val());
                        EBCMS.CORE.do({
                            url:$this.attr('url'),
                            data:$this.data()
                        });
                    },function(){
                        $this.val($this.data('value'));
                    });
                }else{
                    $this.data('value', $this.val());
                    EBCMS.CORE.do({
                        url:$this.attr('url'),
                        data:$this.data()
                    });
                }
            });
        });
    </script>
</head>
<body>

    <script>
        var M = {};
        $(function() {
            M.runtime = function runtime(p){
                EBCMS.CORE.submit({
                    url:'<?php echo url('runtime'); ?>',
                    queryParams:p,
                    success:function(res){
                       EBCMS.MSG.notice(res.msg);
                    }
                });
            };
            setTimeout(function() {
                art.dialog.notice({
                    title: '欢迎！',
                    width: 220,
                    content: '欢迎使用本系统！正在添加更多的功能，尽请期待',
                    icon: 'face-smile',
                    time: 5
                });
            }, 500);
            M.tools = function(opt){
                switch (opt.tool) {
                    case 'jisuanqi':
                        art.dialog({
                            id:'jisuanqi',
                            title:'计算器',
                            time:0,
                            lock: false,
                            fixed: false,
                            drag: true,
                            content: '<iframe src="__ROOT__/tools/jisuanqi/base.html" width="390" height="266" frameborder="0"></iframe>',
                            padding:'0px',
                            button: [{
                                name: '普通计算器',
                                callback: function () {
                                    this.content('<iframe src="__ROOT__/tools/jisuanqi/base.html" width="390" height="266" frameborder="0"></iframe>');
                                    return false;
                                }
                            },{
                                name: '科学计算器',
                                callback: function () {
                                    this.content('<iframe src="__ROOT__/tools/jisuanqi/ext.html" width="700" height="360" frameborder="0"></iframe>');
                                    return false;
                                }
                            }],
                        });
                        break;
                    case 'email':
                        $('#main').attr('src', '<?php echo url('email'); ?>');
                        break;
                    default:
                        /*statements_def*/
                        break;
                }
            };
        });
    </script>
    <div class="layout" style="border-top: 4px solid #00655b;">
        <div class="layout-left" style="width: 180px;margin-right: -180px; background: #e2e9ea; overflow: hidden;">

            <style>
                .navtabs{
                    width: 60px;
                    height: 100%;
                    float: left;
                    background: #125a54;
                    /* border-right: 1px solid #191919; */
                    color: #fff;
                }
                .navtabs div{
                    line-height: 3em;
                    text-align: center;
                    border-bottom: 1px solid #03312e;
                    cursor: pointer;
                    font-size: 1.3em;
                    border-top: 1px solid #2c736d;
                }
                .navtabs div.selected{
                    background: #00796B;
                }
                .navbody{
                    width: 120px;
                    height: 100%;
                    float: left;
                }
                .navbody div{
                    display: none;
                }
                .navbody div ul{
                    margin: 15px 0 0 15px;
                    list-style: none;
                }
                .navbody div ul li a{
                    display: block;
                    margin: 8px 0;
                    /*background: #e6e6e6;*/
                    text-decoration: none;
                    padding: 10px;
                    border-left: 3px solid #e6e6e6;
                }
                .navbody div ul li.cur a{
                    color: #009688;
                    background: #fff;
                    border-left: 3px solid #009688;
                }
                .navbody div ul li a:hover{
                    color: #009688;
                    background: #fff;
                    border-left: 3px solid #009688;
                }
            </style>
            <script>
                $(function() {
                    $('.navtabs div').bind('click', function(event) {
                        var index = $(this).index();
                        $(this).addClass('selected').siblings().removeClass('selected');
                        $('.navbody div').eq(index).show().siblings().hide();
                    });
                    $('.navbody ul li a').bind('click', function(event) {
                        $('.navbody ul li').removeClass('cur');
                        $(this).parent().addClass('cur');
                    });
                });
            </script>
            <div class="navtabs">
                <div class="selected">主页</div>
                <?php if(is_array($menu) || $menu instanceof \think\Collection): if( count($menu)==0 ) : echo "" ;else: foreach($menu as $key=>$vo): ?>
                <div><?php echo $vo['title']; ?></div>
                <?php endforeach; endif; else: echo "" ;endif; ?>
               <div>缓存</div>
            </div>
            <div class="navbody">
                <div style="display: block;">
                    <ul>

                        <li><a href="<?php echo url('index/index/index'); ?>" target="main">主页</a></li>

                    </ul>
                    <ul>

                        <li><a href="<?php echo url('index/index/index'); ?>" target="__blank">新窗口打开</a></li>

                    </ul>
                </div>
                <?php if(is_array($menu) || $menu instanceof \think\Collection): if( count($menu)==0 ) : echo "" ;else: foreach($menu as $key=>$vo): ?>
                <div>
                    <ul>
                    <?php if(is_array($vo['rows']) || $vo['rows'] instanceof \think\Collection): if( count($vo['rows'])==0 ) : echo "" ;else: foreach($vo['rows'] as $key=>$sub): if($sub['title'] == '__DIVIDER__'): ?>
                        <li><span style="margin-left: 13px;">---------</span></li>
                        <?php else: ?>
                        <li><a href="<?php echo $sub['url']; ?>" target="main"><?php echo $sub['title']; ?></a></li>
                        <?php endif; endforeach; endif; else: echo "" ;endif; ?>
                    </ul>

                </div>
                <?php endforeach; endif; else: echo "" ;endif; ?>
                <div>
                    <ul>

                                            <li><a href="javascript:M.runtime({type:'all'});" >清理全部</a></li>
                                                <li><a href="javascript:M.runtime({type:'cache'});" " >数据缓存</a></li>
                                                <li><a href="javascript:M.runtime({type:'tpl'});"  >模板缓存</a></li>
                                                <li><a href="javascript:M.runtime({type:'log'});"  >日志缓存</a></li>

                    </ul>
                </div>

            </div>
        </div>
        <div class="layout-rightbox">
            <div class="layout-right" style="height:100%;overflow:auto;margin-left: 180px;">
                <iframe src="<?php echo url('index/index/index'); ?>" name="main" id="main" frameborder="0" style="width:100%;height:100%;display: block;"></iframe>
            </div>
        </div>
    </div>
</body>
</html>
